package cn.wolfcode.wolf2w.web.controller;

import cn.wolfcode.wolf2w.service.ISpotService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("spot")
public class SpotController {

    @Autowired
    ISpotService spotService;


    @RequestMapping("insert")
    @ResponseBody
    public Object insert(){
        return spotService.insert();
    }

    @RequestMapping("list")
    @ResponseBody
    public Object list(){
        return JsonResult.success(spotService.list());
    }

    @RequestMapping("getOng")
    @ResponseBody
    public Object getOng(String id){
        return JsonResult.success(spotService.findById(id));
    }
}
